#include <QApplication>

#include "../../common/services/ServiceLocator.h"
#include "../../common/services/IRepositoryService.h"
#include "../../common/services/impl/RepositoryService.h"
#include "windows/MainWindow.h"

ServiceLocator *createServiceLocator()
{
	ServiceLocator *serviceLocator = new ServiceLocator();
	serviceLocator->registerService<IRepositoryService, RepositoryService>(
		new RepositoryService());
	return serviceLocator;
}

int main(int argc, char **argv)
{
	QApplication app(argc, argv);
	ServiceLocator *serviceLocator = createServiceLocator();

	MainWindow mainWindow(serviceLocator);
	mainWindow.show();
	mainWindow.init();

	int exitCode = app.exec();

	delete serviceLocator;
	return exitCode;
}
